let path = require('path');

function resolve(dir) {
    return path.join(__dirname, dir);
}

module.exports = {
    publicPath: './',
    lintOnSave: true,
    outputDir: 'dist',
    assetsDir: './static',
    devServer: {
        port: 8080,
        open: true, //是否自动打开浏览器/
        overlay: {
            warnings: false,
            errors: true,
        },
        proxy: {
            '/api': {
                target: 'http://192.168.50.107:9220',
                changeOrigin: true,
                ws: true, //开启 WebSocket 的支持
                pathRewrite: {
                    '^/api': '/api',
                },
            },

        },
    },
    chainWebpack: (config) => {
        config.resolve.alias.set('/@', resolve('src'));
    },
};
